<style type="text/css">
.carousel-inner .item img{
	max-width: 100%;
    max-height: 100%;
    vertical-align: middle;
	height:82px;
}
.star-rate {margin-left:0}
.fe-floatright-bottom a {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 100%;
    background-color: #ff9999;
    color: #fff;
    line-height: 0.7rem;
	font-size:0.45rem;
    margin: 0.5rem auto;
    margin-right: 0;
}
.fe-floatright-bottom a .icon {
    color: #fff;
    font-size: 0.6rem;
    height: 0.6rem;
	line-height: 1rem;
    opacity: 1;
}
.fui-icon-group .fui-icon-col.active .text {
    color: red;
}
.btn {
    margin:0.1rem
}
.btn.btn-gray {
    background: #f2f2f2;
    border: 0;
}
.btn.btn-gray.active {
    color: red;
}
</style>

<div class="fui-page-group ">
<div class="fui-page  fui-page-current page-goods-list">
	<div class="fui-header">
		<div class="fui-header-left" ng-click="pagedata.showarea =1">
			<span ng-show="pagedata.params.district" style="font-size:0.65rem">{{pagedata.params.district}}</span>
			<span ng-show="!pagedata.params.district" style="font-size:0.65rem">{{pagedata.params.city || '广州市'}}</span>
			<i class="icon jinyunicon icon-moreunfold"></i>
		</div>
		<div class="title">
			<form method="post">
					<div class="searchbar searchbar-active" style="margin-left:3.2rem;margin-right:0.5rem">
					<div class="search-input">
						<i id="searchsub" class="icon jinyunicon icon-search"  ng-click="getlist(pagedata.params.keyword)" style="font-size: 1.0rem;"></i>
						<input type="search" id="search" placeholder="输入关键字..." ng-model="pagedata.params.keyword">
					</div>
					</div>
			</form>
		</div>
    </div>
	
	<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true" style="margin-top:2rem">
			<div class="carousel-inner" role="listbox" style="height:6rem">
			<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.adv">
				<a href="javascript:;" ng-click="access_json(item.url)">
					<img src="{{tomedia(item.image) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
				</a>
			</div>
			</div>
				<style>
						.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
						.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
				</style>
				<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
					<div class="fui-swipe-bullet" ng-repeat="item in pagedata.adv" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
				</div>
	</div>
	<div class="fui-icon-group noborder col-5" style="background: #ffffff">
			<a class="fui-icon-col external {{pagedata.params.group_id==0?'active':''}}"  href="javascript:;" ng-click="pagedata.params.group_id=0;pagedata.params.ccate='';pagedata.showccate=false;tool.get_list('jy_cmso2o/index/list/',true);" data-nocache="true">
				<div class="icon"><i class="icon icon-all"></i></div>
				<div class="text">全部</div>
			</a>
			<a class="fui-icon-col external  {{pagedata.params.group_id==item.id?'active':''}}" ng-repeat="item in pagedata.group" href="javascript:;" ng-click="pagedata.params.group_id=item.id;pagedata.showccate=true;pagedata.nowccates=item.ccates;tool.get_list('jy_cmso2o/index/list/',true);" data-nocache="true">
				<div class="icon"><img ng-src="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}"></div>
				<div class="text">{{item.title}}</div>
			</a>
	</div>
	<div ng-if="pagedata.showccate" style="background:#ffff;padding:0.3rem 0.5rem;padding-bottom:1rem">
		<span class="btn btn-gray {{!pagedata.params.ccate?'active':''}}" ng-click="pagedata.params.ccate='';pagedata.showcolor=false;tool.get_list('jy_cmso2o/index/list/',true);">
		全部
		</span>
		<span ng-repeat="(k,v) in pagedata.nowccates" class="btn btn-gray {{pagedata.params.ccate==v.id?'active':''}}" ng-click="pagedata.params.ccate=v.id;tool.get_list('jy_cmso2o/index/list/',true);">
			{{v.title}}
		</span>
	</div>
	<div class="sort" style="top:0.2rem">
		<div class="item" ng-class="{'on':pagedata.status==1}" ng-click="pagedata.params.order='zhonghe';getlist();pagedata.status=1"><span class="text">综合</span></div>
		<div class="item" ng-class="{'on':pagedata.status!=1}" data-order="sales" href="javascript:" ng-click="pagedata.params.order='juli';getlist();pagedata.status=0"><span class="text">距离</span></div>
		<div class="fui-list-group merchgroup" ng-repeat="item in pagedata.list" >
            <div class="fui-list">
                <a class="fui-list-media storelogo" href="javascript:;" ng-click="access_json('/detail//id='+item.id)">
                    <img class="round" ng-src="{{tomedia(item.logo) || '../core/resource/images/nopic.jpg'}}">
                </a>
                <a class="fui-list-inner" style="margin-top:0.16rem" href="javascript:;" ng-click="access_json('/detail//id='+item.id)">
                    <div class="title" style="font-size:0.76rem"><span>{{item.title}}</span></div>
                    <div class="store-star">
						<span class="star-rate">{{item.desc || '该商户还没有添加描述！'}}</span>
					</div>
					<div class="subtitle" style="font-size:0.55rem">
						<div class="store-moneylimit">
						  <span>距您{{item.juli}}公里</span>
						  <span class="store-distance"> 电话：{{item.phone || '无'}}</span>
						</div>
					</div>
                </a>
            </div>
		</div>
		<div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
    </div>
</div>
</div>
<div class="fui-page  fui-page-current page-goods-list" ng-if="pagedata.showarea ==1">
<div class="fui-header">
		<div class="fui-header-left" ng-click="pagedata.showarea =0">
			<a class="back"></a>
		</div>
		<div class="title">
			<form method="post">
					<div class="searchbar searchbar-active">
					<div class="search-input">
						<i class="icon jinyunicon icon-search" style="font-size: 1.0rem;"></i>
						<input type="search" id="search" placeholder="输入关键字..." value="">
					</div>
					</div>
			</form>
		</div>
		<div class="fui-header-right" data-nomenu="true">
			<a href="javascript:;"><i class="icon jinyunicon icon-saoyisao2" id="listblock" style="font-size: 1.0rem;"></i></a>
		</div>
</div>
<div class="fui-content" style="top:1.3rem">
		<div class="weui_cells weui_cells_access">
				<a class="weui_cell" href="javascript:;">
					<div class="weui_cell_bd weui_cell_primary" style="padding:0">
						<span>当前定位/选择地区：{{pagedata.params.city || '广州市'}}</span>
					</div>
					<div class="weui_cell_ft" ng-click="toogle(post,'show')">
						选择县区
					</div>
				</a>
				<div class="row margin0" ng-show="post.show">
						<div class="jy-3" ng-repeat="value in pagedata.province[pagedata.params.province][pagedata.params.city]">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea(pagedata.params.province,pagedata.params.city,value);pagedata.showarea = 0;">
									<div>{{value}}</div>
									<div class="clear"></div>
							</div>
						</div>
				</div>
			</div>
			<div class="weui_cells_title">热门地区</div>
			<div class="weui_cells">
				<div class="row margin0">
					<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('广东省','深圳市','');pagedata.showarea = 0;">
									<div>深圳市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('上海市','上海市','');pagedata.showarea = 0;">
									<div>上海市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('广东省','东莞市','');pagedata.showarea = 0;">
									<div>东莞市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('北京市','北京市','');pagedata.showarea = 0;">
									<div>北京市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('江苏省','南京市','');pagedata.showarea = 0;">
									<div>南京市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="selectarea('江苏省','杭州市','');pagedata.showarea = 0;">
									<div>杭州市</div>
									<div class="clear"></div>
							</div>
						</div>
				</div>
			</div>
			<div ng-repeat="(value,data) in pagedata.province">
				<div class="weui_cells_title">{{value}}</div>
				<div class="weui_cells">
					<div class="row margin0">
						<div class="jy-3" ng-repeat="(city,data) in pagedata.province[value]">
								<div class="yuyue-duan" style="width:auto" ng-click="selectarea(value,city,'');pagedata.showarea = 0;">
										<div>{{city}}</div>
										<div class="clear"></div>
								</div>
						</div>
					</div>
				</div>
		    </div>
</div>
</div>
<div class="fe-floatright-bottom right" style="bottom:60px;">
			<a href="javascript:;" style="background-color: #ff6666;" ng-click="toogle(pagedata,'show_shopset',[1,0])">
				<i ng-class="{'icon':1,'icon-less':pagedata.show_shopset !=1,'icon-moreunfold':pagedata.show_shopset ==1}" style="font-size:0.8rem;"></i>
				<div style="line-height:0.3rem">{{pagedata.show_shopset !=1?'我的':'关闭'}}</div>
			</a>
</div>
<div ng-if="pagedata.show_shopset" class="fe-floatright-bottom right" style="bottom:6.6rem;">
		<a href="javascript:" ng-click="access_json('jy_cmso2o/detail/')">
			<i class="icon icon-shouye"></i>
			<div style="line-height:0.3rem">商户</div>
		</a>
		<a href="javascript:" ng-click="access_json('jy_cmso2o/merchants/set/')" class="nav-item">
			<i class="icon icon-set"></i>
			<div style="line-height:0.3rem">设置</div>
		</a>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	}); 
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.loading = true;
    // 百度地图API功能
if(!scope.pagedata.lat_lng && !scope.main.lat_lng){
window.scope.location(function(re){
	scope.main.lat_lng=res.lat_lng;
	scope.main.pcd=res.addressComponents;
	if(!scope.pagedata.params.city){
		scope.pagedata.params.province = re.addressComponents.province;
		scope.pagedata.params.city = re.addressComponents.city;
		scope.$evalAsync();
	}
	scope.pagedata.params.lat=re.lat_lng.lat
	scope.pagedata.params.lng=re.lat_lng.lng
	scope.tool.get_list('jy_cmso2o/index/list/',true);
});
}else{
	scope.tool.get_list('jy_cmso2o/index/list/',true);
}
scope.selectarea = function(province,city,district){
	//scope.$apply(function(){
		scope.pagedata.params.province = province;
		scope.pagedata.params.city = city;
		scope.pagedata.params.district = district;
		scope.tool.get_list('jy_cmso2o/index/list/',true);
	//});
}	
scope.tool.get_list('jy_cmso2o/index/list/',true);
scope.getlist=function (key,province,city){
		scope.pagedata.params.province = province?province:scope.pagedata.params.province;
		scope.pagedata.params.city = city?city:scope.pagedata.params.city;
		scope.tool.get_list('jy_cmso2o/index/list/',true);
}
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_cmso2o/index/list/');
}
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>